-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
⚠️ Return an error if the continue list option is set for the cache reader #2439
⚠️ Return an error if the continue list option is set for the cache reader #2439
Conversation
Welcome @shuheiktgw! |
Hi @shuheiktgw. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
@shuheiktgw: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
I believe that I faced the same issue here. |
I have one concern: a typical flow of using pagination is you set As |
Thats on the callers side anyways, because the two are not identical, they just expose an identical interface. You for example have to know that if you get data from cache it might be stale and deal with that properly. |
@@ -111,6 +111,10 @@ func (c *CacheReader) List(_ context.Context, out client.ObjectList, opts ...cli | |||
listOpts := client.ListOptions{} | |||
listOpts.ApplyOptions(opts) | |||
|
|||
if listOpts.Continue != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with this change, however it is technically breaking because using this before would not do anything, now it returns an error. Could you update the title accordingly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I've updated the title 🙂
If that's expected to not implement some options it technically accepts, could we make sure that these intentional gaps are properly documented? |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, shuheiktgw The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This still leads to hard to find bugs if the client tries to use continue (rather than just calling List() once with a limit, ignoring the continue flag). As long as the cache doesn't support continue, List() calls should probably just return an arbitrary non-empy continue string so that if the client copies that into into the next request, they'll fail-fast into this error. rather than just getting a single, seemingly truncated list with no error. |
Hi, currently the cache reader ignores the continue option. This behavior could lead to a hard-to-find bug when a user mistakenly tries to paginate with the limit and continue option by the cache client. I faced the problem, and that was quite hard to debug since the limit option works correctly and I always received the first page only. I believe it is more user-friendly if we just return an error when a user mistakenly set the option instead of ignoring it silently. Thanks for your review!